<?php 
use yii\helpers\html;
use yii\widgets\ActiveForm;
use yii\jui\Widget;
//use yii;
use yii\jui\AutoComplete;
use backend\models\TmeMerchandisecinfo;
use yii\jui\Dialog;
use yii\jui\Droppable;
use yii\jui\Draggable;
use yii\jui\Selectable;

//$name = isset($names)?$names:'是等等';
//var_dump($name);exit; 
$merchandissort = new TmeMerchandisecinfo();
$merchandissortresult = TmeMerchandisecinfo::find()->all();

foreach ($merchandissortresult as $v){	 
	$tempv[]=$v['MerchandiseCID'];
	//$tempv[]=$v['MerchandiseCName'];	
}

?>

<?php 

$form = ActiveForm::begin([	
	'options'=>['enctype'=>'multipart/form-data','class'=>'form-horizontal'],
	'fieldConfig'=>['template' =>'{label}<div class="col-sm-9">{input}{hint}<span class="help-inline col-xs-12 col-sm-7">{error}</span></div>',
	'labelOptions'=>['class' =>'col-sm-3 control-label no-padding-right'],
	'inputOptions'=>['class' =>'col-xs-10 col-sm-4'],
	'errorOptions'=>['class' =>'help-block middle']
	   ]
    ])
/*@var $form yii\widgets\ActiveForm */
?>
<?= $form->field($merchandisinfomodel, 'MerchandiseID') ?>
<?= $form->field($merchandisinfomodel, 'UnitID')->dropDownList($listdate) ?>
<?= $form->field($merchandisinfomodel, 'ProStatusID')->dropDownList($listdate1) ?>
<?= $form->field($merchandisinfomodel, 'MerchandiseCID')->widget(yii\jui\AutoComplete::className(),[
	'options'=>['style'=>["float"=>'left',   ]],	
	'clientOptions'=>[
	 'source'=>$tempv,  
],		
]) 
 ?>
<?= $form->field($merchandisinfomodel, 'MerchandiseName')->textInput() ?>
<?= $form->field($merchandisinfomodel, 'MerchandiseAB')->textInput(["readonly"=>"readonly"]) ?>
<?= $form->field($merchandisinfomodel, 'Price') ?>
<?= $form->field($merchandisinfomodel, 'SaleStatus')->radioList(['0'=>'下架','1'=>'上架']) ?>
<?= $form->field($merchandisinfomodel, 'Spec') ?>
<?= $form->field($merchandisinfomodel, 'Describes')->textarea() ?>
<?= $form->field($merchandisinfomodel, 'PicPath')->fileInput() ?>
<?= $form->field($merchandisinfomodel, 'ClickCount') ?>
<?= $form->field($merchandisinfomodel, 'Remark') ?>

										
<?=Html::input('hidden','action','merchandisadd') ?>
                      
   <div class="form-group has-warning">
   <label for="inputWarning" class="col-xs-10 col-sm-5 control-label no-padding-right"></label>
   <div class="col-xs-12 col-sm-4">															
   <?= Html::submitButton('添加',['class'=>'btn btn-info btn-sm tooltip-info']) ?>
   <?= "&nbsp;&nbsp;"?>
   <?= Html::resetButton('重置',['class'=>'btn btn-danger btn-sm tooltip-error']) ?>
   </div>
   </div>	

<?php
ActiveForm::end()
?>
 
 
 